package com.crrc.dataparse.monitor.base.resource.imp;

import com.crrc.dataparse.monitor.base.resource.IResource;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MemoryResource implements IResource {
    private Map<Object, Object> resource = new HashMap();
    private Map<Object, Object> resourceMap = new HashMap();
    public MemoryResource() {
    }

    public MemoryResource(Map<Object, Object> resource) {
        this.resource = resource;
    }
    @Override
    public Object getResourceItem(Object key) {
        return this.resource.get(key);
    }
    @Override
    public void addResourceItem(Object key, Object value) {
        this.resource.put(key, value);
    }
    @Override
    public void deleteResourceItem(Object key) {
        this.resource.remove(key);
    }
    @Override
    public void updateResourceItem(Object key, Object value) {
        this.resource.put(key, value);
    }
    @Override
    public Object getResource() {
        return this.resource;
    }
    @Override
    public Object getResourceKey(Object obj) {
        return null;
    }

    public void updateResource(Map<Object, Object> value) {
        this.resource.clear();
        this.resource.putAll(value);
    }
    @Override
    public Set<String> getItemKeySet() {
        return null;
    }
    @Override
    public Map<String, String> getItemSet() {
        return null;
    }

    @Override
    public Object getResourceMapItem(Object key) {
        return this.resourceMap.get(key);
    }
    @Override
    public void addResourceMapItem(Object key, Object value) {
        this.resourceMap.put(key, value);
    }

    @Override
    public Object getResourceMap() {
        return this.resourceMap;
    }
}
